<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <?php echo $html->charset(); ?>
  <title><?php __('Administration'); e(' | '); __($title_for_layout); ?></title>
<?php
  echo $html->css('type');
  echo $html->css('style');
  echo $html->css('admin');
  echo $html->css('transmenu');
  if (is_array($javascripts)) {
      foreach ($javascripts as $js) {
          echo $javascript->link($js);
      }
  }
  echo $scripts_for_layout;
?>
<script type="text/javascript" charset="utf-8">
    function setup_transmenu () {
        if (TransMenu.isSupported()) {
            var ms = new TransMenuSet(TransMenu.direction.right, -10, 2, TransMenu.reference.topRight);

            var menu1 = ms.addMenu(document.getElementById('usermanager'));
              menu1.addItem('<?php __('New User'); ?>', '<?php e($this->base); ?>/admin/users/add');
            var menu2 = ms.addMenu(document.getElementById('adcategory'));
              menu2.addItem('<?php __('New AdCategory'); ?>', '<?php e($this->base); ?>/admin/adCategories/add');
            var menu3 = ms.addMenu(document.getElementById('country'));
              menu3.addItem('<?php __('New Country'); ?>', '<?php e($this->base); ?>/admin/countries/add');
            var menu4 = ms.addMenu(document.getElementById('location'));
              menu4.addItem('<?php __('New Location'); ?>', '<?php e($this->base); ?>/admin/locations/add');

            TransMenu.spacerGif = '<?php e($this->base); ?>/img/spacer.gif';
            TransMenu.renderAll();
            TransMenu.initialize();
        }
    } // setup_transmenu

    var mesg = {
        onSaving: '<?php __('Saving..'); ?>',
        onFail: '<?php __('Fail making page request!'); ?>',
        onSuccess: '<?php __('Form data saved!'); ?>',
        invalid: '<?php __('Please enter the requested details in the fields pointed out below and try again!'); ?>'
    };
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
	margin: 0px;
}
-->
</style></head>

<body>

<div>
  <div id="header">
    <div class="dl header"><?php __('Administration'); ?></div>
    <div class="dr button" onclick="goto('<?php e($this->base); ?>/users/logout')"
     style="margin:10px; 10px; padding:7px 16px;"><?php __('Logout'); ?></div>
  </div>
  <div id="mainmenu">
    <div class="dl" onclick="goto('<?php e($this->base); ?>/')"><span class="link hand"><?php __('Classified Homepage'); ?></span></div>
    <div class="dr"><?php __('Logged in as <b>admin</b>'); ?></div>
  </div>
  <div id="iconsbar">
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/pages/cpanel')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_home.jpg);"><?php __('Home'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/adPosts/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_listing.jpg);"><?php __('Listings'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/users/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_user.jpg);"><?php __('User Manager'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/adCategories/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_settings.jpg);"><?php __('Ad Categories'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/settings/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_settings.jpg);"><?php __('Settings'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/countries/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_budatabase.jpg);"><?php __('Countries'); ?></div>
    <div class="dl separator"></div>
    <div class="dl icon" onclick="goto('<?php e($this->base); ?>/admin/locations/')"
     style="background-image:url(<?php e($this->base); ?>/img/admin/top_button_budatabase.jpg);"><?php __('Locations'); ?></div>
  </div>
  <div id="content">
    <table cellpadding="0" cellspacing="0">
      <tr>
<?php if (empty($off_sidebar)) { ?>
        <td class="sidebar" valign="top">
          <div class="nav" onclick="goto('<?php e($this->base); ?>/admin/pages/cpanel')">
            <span style="padding-left:15px"><b><?php __('Home'); ?></b></span>
          </div>
          <div class="nav" onclick="goto('<?php e($this->base); ?>/admin/adPosts/')">
            <span style="padding-left:15px"><b><?php __('Listings'); ?></b></span>
          </div>
          <div id="usermanager" class="nav subnav" onclick="goto('<?php e($this->base); ?>/admin/users/')">
            <span style="padding-left:15px"><b><?php __('User Manager'); ?></b></span>
          </div>
          <div id="adcategory" class="nav subnav" onclick="goto('<?php e($this->base); ?>/admin/adcategories/')">
            <span style="padding-left:15px"><b><?php __('Ad Categories'); ?></b></span>
          </div>
          <div id="adcategory" class="nav subnav" onclick="goto('<?php e($this->base); ?>/admin/settings/')">
            <span style="padding-left:15px"><b><?php __('Settings'); ?></b></span>
          </div>
          <div id="country" class="nav subnav" onclick="goto('<?php e($this->base); ?>/admin/countries/')">
            <span style="padding-left:15px"><b><?php __('Country'); ?></b></span>
          </div>
          <div id="location" class="nav subnav" onclick="goto('<?php e($this->base); ?>/admin/locations/')">
            <span style="padding-left:15px"><b><?php __('Locations'); ?></b></span>
          </div>
        </td>
<?php } ?>
        <td valign="top">
          <div id="innerContent" style="margin:15px 40px; width:800px;">
<?php if ($session->check('Message.flash') || $session->check('Message.auth')) { ?>
            <div id="messageBox" style="margin-bottom:5px;"><?php $session->flash().$session->flash('auth'); ?></div>
            <div class="clear"></div>
<?php } else if ($session->check('Message.email')) { ?>
            <div id="messageBox" style="margin-bottom:5px;"><?php $session->flash('email'); ?></div>
            <div class="clear"></div>
<?php } ?>

<?php echo $content_for_layout; ?>
          </div>
        </td>
      </tr>
    </table>
  </div>
  <div id="footer">
    <?php
      $copyright = $html->link('&copy;','/',array('style'=>'background-color:transparent;'),false,false);;
      e(r(
          array('%copyright%', '%date%', '%sitename%', '%version%'),
          array($copyright, date('Y'), __($sitename,true), 1.3),
          __('Copyright %copyright% %date% %sitename% %version% ™. All rights reserved.',true)
      ));
    ?>
  </div>
</div>

<?php if ($this->params['action'] == 'admin_cpanel') { ?>
<script>
 setup_transmenu();
</script>
<?php } ?>
</body>
</html>
